﻿using LJX.SmartPark.Common.ResponseOutput;
using LJX.SmartPark.Domain.IotInfo.LightPoles;
using LJX.SmartPark.Domain.ParkManage;
using LJX.SmartPark.Domain.SysManage;
using LJX.SmartPark.Service.ParkManage;
using LJX.SmartPark.Service.SysManage;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static LJX.SmartPark.Service.ParkManage.AlarmRecordService;

namespace LJX.SmartPark.WebApi.Controllers.ParkManage
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "ParkManage")]
    public class AlarmRecordController : ControllerBase
    {
        private readonly IAlarmRecordService _AlarmRecordService;
        public AlarmRecordController(IAlarmRecordService AlarmRecordService)
        {
            _AlarmRecordService = AlarmRecordService;
        }

        /// <summary>
        /// 获取总条数
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpGet]
        public int GetCount()
        {
            return _AlarmRecordService.GetCount();
        }

        /// <summary>
        /// 分页显示查询
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        public Response<List<AlarmRecord>> GetAlarmRecordPage(AlarmRecordSelect select)
        {
            var result = _AlarmRecordService.GetAlarmRecordPage(select);
            return result.Result;
        }
    }
}
